package com.example.haojiutao.constant;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


/**
 * @Description:
 * @Author: zhou_yuan
 * @CreateTime： 2024/2/1 15:00
 */


@Component
public class Constants {
    //    public static final String SONGLIST_PIC_PATH ="D:\\实训\\img\\songListPic";
    /* 歌曲图片，歌手图片，歌曲文件，歌单图片等文件的存放路径 */
    //public static String ASSETS_PATH =System.getProperty("user.dir"); //当前服务music-server目录下
//    public static String ASSETS_PATH ="D:\\实训";
//    public static String BANNER_PIC_PATH = "file:" + ASSETS_PATH + "/img/swiper/";
    public static String BANNER_PIC_PATH; //轮播图保存目录
////不能直接给 static 变量注入值，所以此处使用 Set 注入在方法体中为static 变量赋值。
    public static  String GOODSLIST_PIC_PATH;

////不能直接给 static 变量注入值，所以此处使用 Set 注入在方法体中为static 变量赋值。

    ////不能直接给 static 变量注入值，所以此处使用 Set 注入在方法体中为static 变量赋值。
    public static String MESSAGELIST_PIC_PATH;

    public static String AVATOR_PIC_PATH;   //头像的保存路径
    public static String GOODS_PIC_PATH;  //商品
    public static String PIC_PATH; //上传闲置物品
    public static String COMMENT_PIC_PATH;

    public static String GOODS_BANNER_PATH;

    @Value("${assets.path}")
    public void setPath(String assetsPath){
//        轮播图

        BANNER_PIC_PATH = "file:" + assetsPath + "/img/swiper/";

//        商品列表
        GOODSLIST_PIC_PATH = "file:" + assetsPath + "/img/goodsListPic/";
//        消息
        MESSAGELIST_PIC_PATH = "file:" + assetsPath + "/img/messageListPic/";
//        头像
        AVATOR_PIC_PATH = "file:" + assetsPath + "/img/avatorImages/";
        GOODS_PIC_PATH= "file:" + assetsPath + "/img/goodsPic/";
        PIC_PATH= "file:" + assetsPath + "/img/"; //上传闲置物品
        COMMENT_PIC_PATH = "file:" + assetsPath + "/img/commentPic/";
        GOODS_BANNER_PATH = "file:" + assetsPath + "/img/goodsBanner/";
    }
}

